/**
 * 
 * If you have edited the file, please update
 * all the last-modified fields manually. Thanks!
 *
 * @last-modified by: 
 * @last-modified date: 
 * @last-modified time: 
 *
 * @author Swee Zhi
 * @date-created Sep 12, 2011    @time-created 6:57:41 PM
 *
 * @project: 
 * @module: 
 * @institution: 
 *
 */
package util.enumhelper;

import util.enumeration.Gender;
import util.enumeration.Language;

public class LocalizedGender {

    // alphabetical order
    public static String getLocalizedGenderAsString(Gender gender, String locale) {
        String localizedGender = "";
        
        // en_US ENGLISH, UNITED STATES
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_US))) {
            localizedGender = getGender_EN_US(gender);
        }
        // en_SG ENGLISH, SINGAPORE
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_SINGAPORE))) {
            localizedGender = getGender_EN_SG(gender);
        }
        // ms_MY MALAY, MALAYSIA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.MALAY))) {
            localizedGender = getGender_MS_MY(gender);
        }
        
        // zh_CN CHINESE, CHINA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.CHINESE_CHINA))) {
            localizedGender = getGender_ZH_CN(gender);
        }
        // other language...
        else {
            localizedGender = getGender_EN_US(gender);
        }
        
        return localizedGender;
    }
    
    // simplified chinese (zh_CN)
    private static String getGender_ZH_CN(Gender gender) {
        String localizedGender = "";
        
        switch (gender) {
            case MALE: localizedGender = "男性" ; break;
            case FEMALE: localizedGender = "女性"; break;
        }
        return localizedGender;
    }
    
    // default (en_US)
    private static String getGender_EN_US(Gender gender) {
        String localizedGender = "";
        
        switch (gender) {
            case MALE: localizedGender = "Male" ; break;
            case FEMALE: localizedGender = "Female"; break;
        }
        return localizedGender;
    }
    
    // singapore english (en_SG)
    private static String getGender_EN_SG(Gender gender) {
        String localizedGender = "";
        
        switch (gender) {
            case MALE: localizedGender = "Male" ; break;
            case FEMALE: localizedGender = "Female"; break;
        }
        return localizedGender;
    }
    
    // bahasa malaysia (ms_MY)
    private static String getGender_MS_MY(Gender gender) {
        String localizedGender = "";
        
        switch (gender) {
            case MALE: localizedGender = "Lelaki" ; break;
            case FEMALE: localizedGender = "Wanita"; break;
        }
        return localizedGender;
    }
    
    // new gender for localized language template (copy and paste to use)
//    private static String getGender_XX_YY(Gender gender) {
//        String localizedGender = "";
//        
//        switch (gender) {
//            case MALE: localizedGender = "" ; break;
//            case FEMALE: localizedGender = ""; break;
//        }
//        return localizedGender;
//    }
}
